package _interview150;

import java.util.ArrayList;

/**
 * 9. 回文数
 */
public class No9 {
    public boolean isPalindrome(int x) {
        return isSame(x + "");
    }

    private boolean isSame(String str) {
        int left = 0, right = str.length() - 1;
        while (left < right) {
            if (str.charAt(left++) != str.charAt(right--)) return false;
        }
        return true;
    }
}
